Skip to content

Conversation

@srbhaakamai
Copy link

@srbhaakamai srbhaakamai commented Sep 15, 2025

📝 Description

Provide go SDK support to ACLP clients to perform CRUD operations for Alerts.

✔️ How to Test

How do I run the relevant unit/integration tests?

Prerequisites
Go 1.19+ installed
Valid Linode API token with monitor permissions
Export LINODE_TOKEN environment variable for integration tests

Run all monitor alert definition unit tests:
UNIT TEST:
go test ./test/unit -run ".MonitorAlertDefinition." -v

Expected Output:

✅ TestCreateMonitorAlertDefinition
✅ TestCreateMonitorAlertDefinitionWithIdempotency
✅ TestGetMonitorAlertDefinition
✅ TestListMonitorAlertDefinitions
✅ TestUpdateMonitorAlertDefinition
✅ TestUpdateMonitorAlertDefinition_LabelOnly
✅ TestDeleteMonitorAlertDefinition

INTEGRATION TEST:
export LINODE_TOKEN="your-linode-api-token"
go test ./test/integration -run "TestMonitorAlertDefinition_smoke" -v

Test Coverage:

List Operations: Validates fetching existing alert definitions
Channel Discovery: Finds available alert channels for testing
Create: Tests complex alert definition creation with:
TriggerConditions (evaluation periods, polling intervals)
RuleCriteria with Rules (metrics, operators, thresholds)
DimensionFilters (node type filtering)
Update: Tests label-only updates with proper timing
Delete: Tests cleanup with exponential backoff retry logic
Expected Duration: ~102 seconds (includes API timing requirements)

📷 Preview

If applicable, include a screenshot or code snippet of this change. Otherwise, please remove this section.

yec-akamai and others added 12 commits September 5, 2025 12:20
…ling (linode#803)

* lkee

* add stack type const

* update monthly transfer fixture
…inode#809)

* build(deps): bump github.com/stretchr/testify from 1.10.0 to 1.11.1

Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.10.0 to 1.11.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](stretchr/testify@v1.10.0...v1.11.1)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-version: 1.11.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* make tidy

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Zhiwei Liang <zliang@akamai.com>
Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](actions/github-script@v7...v8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5 to 6.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Vinay <143587840+vshanthe@users.noreply.github.com>
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Vinay <143587840+vshanthe@users.noreply.github.com>
Bumps [actions/stale](https://github.com/actions/stale) from 9 to 10.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](actions/stale@v9...v10)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-version: '10'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Vinay <143587840+vshanthe@users.noreply.github.com>
* Remove AddPlacementGroups user grant

* golangci-lint fmt

* Remove from unit test
… 1.23 to 1.24 (linode#811)

* build(deps): bump golang.org/x/text from 0.28.0 to 0.29.0

Bumps [golang.org/x/text](https://github.com/golang/text) from 0.28.0 to 0.29.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](golang/text@v0.28.0...v0.29.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-version: 0.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* make tidy and go/toolchain version tidy up

* fix

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Zhiwei Liang <zliang@akamai.com>
Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com>
* build(deps): bump golang.org/x/net from 0.43.0 to 0.44.0

Bumps [golang.org/x/net](https://github.com/golang/net) from 0.43.0 to 0.44.0.
- [Commits](golang/net@v0.43.0...v0.44.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-version: 0.44.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* make tidy

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Zhiwei Liang <zliang@akamai.com>
@srbhaakamai srbhaakamai requested a review from a team as a code owner September 15, 2025 13:55
@srbhaakamai srbhaakamai requested review from Copilot, jriddle-linode and yec-akamai and removed request for a team September 15, 2025 13:55
@srbhaakamai srbhaakamai marked this pull request as draft September 15, 2025 13:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces ACLP (Alerting Linode Platform) SDK functionality to the linodego client library, adding support for monitor alert definitions and channels. The implementation includes API client methods, data structures, and comprehensive test coverage.

  • Adds monitor alert definitions CRUD operations with support for v4beta API endpoints
  • Implements monitor channels functionality for alert notification management
  • Provides comprehensive unit and integration test coverage for all new functionality

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
monitor_alert_definitions.go Core implementation of alert definitions API client methods and data structures
monitor_channels.go Monitor channels API client methods and channel management functionality
request_helpers.go New helper function for v4beta API endpoint formatting
test/unit/base.go Enhanced test base to support v4beta endpoint mocking
test/unit/monitor_alert_definitions_test.go Comprehensive unit tests for alert definitions functionality
test/integration/monitor_alert_definitions_test.go Integration test with real API interaction scenarios
test/integration/fixtures/TestMonitorAlertDefinition_instance.yaml Test fixture data for integration testing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

srbhaakamai and others added 11 commits September 15, 2025 19:54
* build(deps): bump golang.org/x/oauth2 from 0.30.0 to 0.31.0

Bumps [golang.org/x/oauth2](https://github.com/golang/oauth2) from 0.30.0 to 0.31.0.
- [Commits](golang/oauth2@v0.30.0...v0.31.0)

---
updated-dependencies:
- dependency-name: golang.org/x/oauth2
  dependency-version: 0.31.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* make tidy

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Zhiwei Liang <zliang@akamai.com>
…de#817)

* Change types of interfaces create options slices to be pointers

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Run golangci-lint fmt

* Fix go docs
@srbhaakamai srbhaakamai closed this Oct 4, 2025
@srbhaakamai srbhaakamai reopened this Oct 4, 2025
@srbhaakamai srbhaakamai force-pushed the main branch 3 times, most recently from 9226cfb to 8e71881 Compare October 4, 2025 04:43
srbhaakamai and others added 2 commits October 13, 2025 13:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…finitions

- Updated AlertChannel struct to match Python SDK structure
- Fixed API endpoints to use correct monitor/alert-channels path
- Added CriteriaCondition enum for alert definition criteria
- Ensured field naming consistency between Go and Python SDKs
- Fixed integration test to use ListAlertChannels instead of non-existent GetAlertChannels
- All unit tests and integration tests pass successfully
- Full CRUD operations validated with real API
@srbhaakamai srbhaakamai marked this pull request as ready for review October 13, 2025 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants